﻿<%@ Page Language="C#" MasterPageFile="~/cms/cms.master" AutoEventWireup="true"
 CodeFile="users.aspx.cs" Inherits="cms_users" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="main-title">Danh sách người sử dụng của nhóm "<asp:Label runat="server" ID="lblTitle"></asp:Label>"
        <asp:Label ID="lblMsg" runat="server" ForeColor="Red"></asp:Label>
    </div>
    <div class="main-content">
        <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="false"
            BorderStyle="None" DataKeyNames="UserName" Width="100%">
            <Columns>
                <asp:TemplateField HeaderText="Tên đăng nhập" >
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblUserName" Text='<%# Eval("UserName") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:BoundField DataField="Email" HeaderText="Địa chỉ email" >
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="CreateDate" HeaderText="Ngày đăng ký">
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:BoundField DataField="LastLoginDate" HeaderText="Đăng nhập cuối">
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:TemplateField ShowHeader="False" HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:ImageButton ID="ibtDelete" runat="server" 
                            ImageUrl="~/images/delete_over.gif" onclick="ibtDelete_Click" 
                            onclientclick="return confirm('Bạn có chắc chắn muốn loại tài khoản này khỏi nhóm?');" />
                    </ItemTemplate>
                    <ItemStyle Width="40px" HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="gridHeader" />
            <RowStyle CssClass="gridRow" />
            <PagerStyle CssClass="gridPage" />
            <FooterStyle CssClass="gridFooter" />
            <EmptyDataTemplate>
                Chưa có tài khoản nào trong nhóm.
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    <div class="main-title">Thêm người sử dụng vào nhóm:</div>
    <div class="main-content">
        <div class="gridviewAddNewButton">
            <div style="float:left;">
                <asp:DropDownList ID="drlUsers" runat="server" 
                    Width="220px" DataSourceID="odsUsers" DataTextField="UserName" 
                    DataValueField="UserName">
                </asp:DropDownList>    
            </div>
            <div style="float:left;">
                <asp:DropDownList ID="drlRoles" runat="server" Width="220px" DataSourceID="odsRoles"></asp:DropDownList>
            </div>
            <asp:Button ID="btnAddUserToRole" runat="server" Text="Thực hiện" 
                onclick="btnAddUserToRole_Click" />
        </div>
        <asp:ObjectDataSource ID="odsUsers" runat="server" TypeName="System.Web.Security.Membership"
         SelectMethod="GetAllUsers">
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="odsRoles" TypeName="System.Web.Security.Roles" runat="server"
         SelectMethod="GetAllRoles" >
        </asp:ObjectDataSource>
    </div>
</asp:Content>

